<!--
 * @Descripttion: 
 * @version: 1.0
 * @Author: 任静
 * @Date: 2020-10-21 20:03:21
 * @LastEditors: 任静
 * @LastEditTime: 2020-10-21 22:47:47
-->
<template>
  <div>
    <h2>试题管理</h2>
    <el-button @click="handleCreate">上传试题</el-button>
     <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      prop="date"
      label="日期"
      width="150">
    </el-table-column>
    <el-table-column
      prop="date"
      label="科目"
      width="150">
    </el-table-column>
    <el-table-column label="周考一试题数量">
      <el-table-column
        prop="name"
        label="可用"
        width="120">
      </el-table-column>
       <el-table-column
        prop="name"
        label="禁用"
        width="120">
      </el-table-column>
       <el-table-column
        prop="name"
        label="删除"
        width="120">
      </el-table-column>
     
    </el-table-column>
     <el-table-column label="周考二试题数量">
      <el-table-column
        prop="name"
        label="可用"
        width="120">
      </el-table-column>
       <el-table-column
        prop="name"
        label="禁用"
        width="120">
      </el-table-column>
       <el-table-column
        prop="name"
        label="删除"
        width="120">
      </el-table-column>
     
    </el-table-column>
     <el-table-column label="周考三试题数量">
      <el-table-column
        prop="name"
        label="可用"
        width="120">
      </el-table-column>
       <el-table-column
        prop="name"
        label="禁用"
        width="120">
      </el-table-column>
       <el-table-column
        prop="name"
        label="删除"
        width="120">
      </el-table-column>
    
    </el-table-column>
      <el-table-column label='操作'>
       <el-button
          size="mini"
          @click="handleShow">查看</el-button>
     </el-table-column>
  </el-table>
    <!-- 添加弹框 -->
    <el-dialog title="创建试卷" :visible.sync="createDialogVisible">
      <el-form :label-position="testform" label-width="80px" :model="testform">
        <el-form-item label="考试标题">
          <el-input v-model="testform.title" />
        </el-form-item>
        <el-form-item label="试题类型">
          <el-input v-model="testform.type" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="createDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="handleSave">创建考试试卷</el-button>
      </span>
    </el-dialog>
    <!-- 下载弹框 -->
    <el-dialog title="试题列表" :visible.sync="ShowDialogVisible">
      <el-form :label-position="testform" label-width="80px" :model="testform">
        <el-form-item label="编号">
          <el-input v-model="testform.title" />
        </el-form-item>
        <el-form-item label="试题类型">
          <el-input v-model="testform.type" />
        </el-form-item>
         <el-form-item label="创建时间">
          <el-input v-model="testform.type" />
        </el-form-item>
         <el-form-item label="试题状态">
          <el-input v-model="testform.type" />
        </el-form-item>
         <el-form-item label="试题">
          <el-input v-model="testform.type" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="DownloadDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="handleSave">创建考试试卷</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          date: '2016-05-03',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        }
      ],
      testform: {
        title: "",
        type: "",
      },
      createDialogVisible: false, //创建弹框
      ShowDialogVisible: false, //查看弹框
    };
  },
  methods: {
    handleEdit(index, row) {
      console.log(index, row);
    },
    handleDelete(index, row) {
      console.log(index, row);
    },
    //显示创建试卷弹框
    handleCreate() {
      console.log(this.createDialogVisible);
      this.createDialogVisible = true;
    },
    // 保存修改
    handleSave() {
      this.createDialogVisible = false;
      console.log(this.testform);
    },
  //查看弹框
  handleShow(){
      this.ShowDialogVisible=true
  }
  },
};
</script>

<style lang="scss" scoped>
</style>